#include "CameraLib/camera.h"
#include "Henning_PID.h"
#include "input.h"

#ifndef _HENNINGCAMERA_H
#define _HENNINGCAMERA_H

#define PAN_VALUE .05
#define GET_SERVO_VALUE(x) ((x->Get() * 2) - 1)

class Camera {
	InputHandler *m_input;
	CameraLib::Camera *m_cam;
	Servo *m_servoHorizontal, *m_servoVertical;
	PID *m_pidHorizontal, *m_pidVertical;
	float m_panH, m_panV;
	double m_timeStamp;
public:
	CameraLib::Flag target;
	bool hasTarget;
	Camera::Camera(TrackingThreshold primaryColor, TrackingThreshold secondaryColor, CameraLib::MyOrder me, int horizontalServo, int verticalServo, InputHandler* input);
	void Camera::Calculate();
	void Camera::Thread();
	void Camera::Run();
	
	bool Camera::CanFire();
	void Camera::Pan();
	void Camera::FollowTarget();
	CameraLib::Flag Camera::AcquireTarget(std::list<CameraLib::Flag> flags);
	float Camera::GetAngle();
	void Camera::SetServos(float horizontal, float veritcal);
	void Camera::print();
};

//int HenningThreadCamera() {return 1;}

#endif
